package com.neusoft.neuiotms.dcom.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;
import com.neusoft.neuiotms.dcom.model.enums.InspectionItemValueStatus;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_inspection_task_item_value")
@org.hibernate.annotations.Table(appliesTo = "neuiot_inspection_task_item_value", comment = "巡检项值表")
public class InspectionTaskProjectItemValue extends AbstractModel {

    private static final long serialVersionUID = 7871756042433458598L;

    @ManyToOne
    private InspectionRuleProjectItem ruleProjectItem;

    @ManyToOne(targetEntity = InspectionTaskProject.class, cascade = {CascadeType.ALL })
    private InspectionTaskProject inspectionTaskProject;

    @Length(max = 255, message = "巡检项值不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL COMMENT '巡检项值'")
    private String value;

    @Enumerated(EnumType.STRING)
    @Column(length = 12, nullable = true)
    @Comment("varchar(12) NULL COMMENT '正常/异常/未巡检'")
    private InspectionItemValueStatus status = InspectionItemValueStatus.uninspected;

}
